package com.example.leetcode.twopoint;

import com.example.leetcode.twopoint.common.TwoPointUtils;

import java.util.List;

class Solution15 {
    public List<List<Integer>> threeSum(int[] nums) {
        return TwoPointUtils.threeSum(nums);
        // 哈希三数之和很麻烦, 去重判断没写好也会超时
//        return HashUtils.threeSum(nums);
        // 回溯超时
//        return BackTraceUtils.threeSum(nums);
    }
}

public class leetcode15 {
    public static void main(String[] args) {
        Solution15 solution15 = new Solution15();
        int[] nums = {-1, 0, 1, 2, -1, -4};
        int[] nums1 = {-4, -2, 1, -5, -4, -4, 4, -2, 0, 4, 0, -2, 3, 1, -5, 0};
        int[] nums3 = {0, 0, 0, 0};
        System.out.println(solution15.threeSum(nums));
        System.out.println(solution15.threeSum(nums1));
        System.out.println(solution15.threeSum(nums3));
    }
}
